package com.heisenhub.file.utils;

import com.heisnenhub.common.module.exception.RRException;
import com.heisnenhub.common.module.utils.HubObjectUtils;
import org.springframework.web.multipart.MultipartFile;

public class FileUtils {


    /**
     *  获取文件拓展名
     * @param originalFilename
     * @return
     */
    public static String  extName(String originalFilename ){

        if(HubObjectUtils.isEmpty(originalFilename)) throw new RRException("filename is null");


        return originalFilename.substring(originalFilename.lastIndexOf(".") + 1);

    }
}
